package wuji.demospringclouduserconsumer.controller;

import org.springframework.web.bind.annotation.*;
import wuji.demospringclouduserconsumer.service.UserServiceFeign;
import wuji.pojo.User;


import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@RestController
public class UserController {

    @Resource
    private UserServiceFeign userServiceFeign ;


    @RequestMapping("/login")
    public User login(@RequestParam(name = "username")String username, @RequestParam(name = "password")String password) {
        User loginUser = null ;

        loginUser = userServiceFeign.login(username, password) ;


        return loginUser ;
    }

    @RequestMapping("/user/userList")
    public List<User> userList() {
        System.out.println("调用consumer1的userlist");
        return userServiceFeign.userList() ;
    }


}
